package com.shengyuan.manage_os.old.ying.erpm;

import android.os.Bundle;

import com.shengyuan.manage_os.R;
import com.shengyuan.manage_os.im.ECApplication;

import org.json.JSONException;


public class Actual_Form_PiZhongLiang_2 extends Actual_Form_PiZhongLiang {
	@Override
	public String MyID() {
		return getClass().getName();
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState, true);
		MainApplication.currentActivity = this;
		setContentView(R.layout.actual_form_pizhongliang_2);
		InitControls();
		GetSpinnerCar2(Actual_Form_ZongZhongLiang.class.getName());
	}

	@Override
	protected void SaveJsonData() {
		try {
			IsJson1 = false; mFinished = 1;
			JsonMyID();
			getZhongLiang();

			getCurrentUser();
			getGPS();
			getMemo();
			JsonPicture();
//			JsonPicture_Ext();
		}catch (Exception e) {
		}
	}

	protected void JsonPicture() throws JSONException {
		if (PictureButton_Car!=null) {
			mJson.put( PictureButton_Car.FIELD+getString(R.string.title_actual_form_PictureButton), PictureButton_Car.mFileName);
		}
		if (PictureButton_CaiLiao!=null) {
			mJson.put( PictureButton_CaiLiao.FIELD+getString(R.string.title_actual_form_PictureButton), PictureButton_CaiLiao.mFileName);
		}

		if (PictureButton_bengshang!=null) {
			mJson.put( PictureButton_bengshang.FIELD+getString(R.string.title_actual_form_PictureButton), PictureButton_bengshang.mFileName);
		}
		if (PictureButton_bengma!=null) {
			mJson.put( PictureButton_bengma.FIELD+getString(R.string.title_actual_form_PictureButton), PictureButton_bengma.mFileName);
		}
	}
	
	@Override
	protected void SpinnerToEditText(int index) {
		SetEditValueAndFalse(editText_chexing, index, getString(R.string.title_actual_form_editText_chexing));
		SetEditValueAndFalse(editText_cailiao, index, getString(R.string.title_actual_form_editText_cailiao));

		if (editText_gongyingshang!=null) {
			SetEditValueAndFalse(editText_gongyingshang, index, getString(R.string.title_actual_form_editText_gongyingshang));
		}
		if (editText_zongzhongliang!=null) {
			SetEditValueAndFalse(editText_zongzhongliang, index, getString(R.string.title_actual_form_editText_zongzhongliang));
		}
	}
	

}
